# Contributor: Eli Schwartz <eschwartz@archlinux.org>

_pkgname=hotdoc
pkgname=hotdoc
pkgver=0.14.1
pkgrel=2
pkgdesc="the tastiest API documentation system"
arch=('loong64' 'x86_64')
url="https://github.com/${_pkgname}/${_pkgname}"
license=('LGPL')
_py_deps=('appdirs' 'charset-normalizer' 'dbus-deviation' 'lxml' 'networkx'
          'pkgconfig' 'schema' 'toposort' 'wheezy-template' 'yaml' 'feedgen')
depends=("${_py_deps[@]/#/python-}" 'json-glib')
makedepends=('python-setuptools' 'python-build' 'python-installer'
             'python-wheel' 'cmake')
optdepends=('clang: for the C extension'
            'llvm: for the C extension')
source=("https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/${_pkgname}/${_pkgname}-${pkgver}.tar.gz")
sha256sums=('c11c7d9f495c4b20150f77393402f01f0ce0d9f650cb5f644a359d53f50b7982')
b2sums=('4c0d8e8cad1246db90f13327b8d21edf8fea0aa79403a2e3370dff0a9a97e88d149e3b1fd16c0cb37df2c3d418b3662f2d6d789567c1bd208543007f83508c79')

build() {
    cd ${pkgname}-${pkgver}

    python -m build --wheel --no-isolation
}

check() {
    cd ${pkgname}-${pkgver}/build/lib.linux-$CARCH-cpython-*

    python -m unittest
}

package() {
    cd ${pkgname}-${pkgver}

    python -m installer --destdir="${pkgdir}" dist/*.whl
}
